package day_803;

import java.awt.GridBagLayout;
import java.awt.GridLayout;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

public class zhuceDome {
	public static void main(String[] args) {
		JFrame zhuce = new JFrame();

		JPanel jPanel = new JPanel();

		// 设置格式 网格状 三行一列
		jPanel.setLayout(new GridLayout(3, 1));

		// 创建组件
		JPanel sport = new JPanel();
		JLabel label = new JLabel("你喜欢的运动");
		JCheckBox zuqiu = new JCheckBox("足球");
		JCheckBox lanqiu = new JCheckBox("篮球");
		JCheckBox wangqiu = new JCheckBox("网球");
		sport.add(label);
		sport.add(zuqiu);
		sport.add(lanqiu);
		sport.add(wangqiu);
		jPanel.add(sport);
		// 设置性别
		JPanel sex = new JPanel();
		JLabel sextest = new JLabel("你的性别");
		JRadioButton man = new JRadioButton("男");
		JRadioButton wuman = new JRadioButton("女");
		ButtonGroup buttonGroup = new ButtonGroup();
		buttonGroup.add(man);
		buttonGroup.add(wuman);
		sex.add(sextest);
		jPanel.add(sex);
		sex.add(man);
		sex.add(wuman);
		// 设置登录 取消按钮

		JPanel anniu = new JPanel();
		JButton denglu = new JButton("登录");
		JButton quxiao = new JButton("取消");
		anniu.add(denglu);
		anniu.add(quxiao);
		jPanel.add(anniu);
		//
		zhuce.setDefaultCloseOperation(zhuce.EXIT_ON_CLOSE);
		zhuce.setSize(300, 150);
		zhuce.setVisible(true);
		zhuce.add(jPanel);

	}

}
